Support glibc 2.24
authorRob Browning <rlb@defaultvalue.org>
Mon, 5 Sep 2016 20:00:48 +0000 (15:00 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 5 Sep 2016 20:00:55 +0000 (15:00 -0500)
Add 0022-Emacs-should-work-with-glibc-2.24-on-ppc64.patch to incorporate
the relevant upstream code. Thanks to Aurelien Jarno for reporting the
problem and backporting the fix.

Closes: 833727
1  2 
debian/.git-dpm
debian/patches/0022-Emacs-should-work-with-glibc-2.24-on-ppc64.patch
debian/patches/series

diff --cc debian/.git-dpm
index 3f35bda492075471f137425e5128e5cb54212142,0000000000000000000000000000000000000000..b9a32e427a679f55f40cb74a15007a2e7fb6f3c2
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,8 @@@
- f07b5081dc17404b73acfc9da576d9746d276b7a
- f07b5081dc17404b73acfc9da576d9746d276b7a
 +# see git-dpm(1) from git-dpm package
++3a838494fc769f1ae39adf20325869331f0c300d
++3a838494fc769f1ae39adf20325869331f0c300d
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +emacs24_24.5+1.orig.tar.bz2
 +790a17cf600831dd5c36afddb9cb48bc5482e6c9
 +24401779
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9254f0c1f74885b071eb99ee6a94907713d15eb9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,126 @@@
++From 3a838494fc769f1ae39adf20325869331f0c300d Mon Sep 17 00:00:00 2001
++From: Paul Eggert <eggert@cs.ucla.edu>
++Date: Fri, 15 Jul 2016 13:07:09 +0200
++Subject: Emacs should work with glibc 2.24 on ppc64
++
++This patch, backported from upstream by Aurelien Jarno
++<aurel32@debian.org>, has been added:
++
++  Port to glibc 2.24 (pre-release) + ppc64
++
++  Inspired by a suggestion by Florian Weimer in:
++  https://sourceware.org/ml/libc-alpha/2016-07/msg00425.html
++  * configure.ac (HAVE_PERSONALITY_ADDR_NO_RANDOMIZE):
++  Rename from HAVE_PERSONALITY_LINUX32, and check for
++  ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
++  All uses changed.
++  * src/emacs.c (main) [HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]:
++  Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
++  flag ourselves.  Just set that flag, rather than also setting the
++  persona.  When doing it, avoid functions like putenv that may
++  allocate memory.
++
++Origin: backport, commit: e95b023163e96538b15f030b7176b7ec59cf86f5
++Bug-Debian: http://bugs.debian.org/833727
++Added-by: Rob Browning <rlb@defaultvalue.org>
++---
++ admin/CPP-DEFINES |  2 +-
++ configure.ac      | 20 +++++++++++---------
++ src/emacs.c       | 30 ++++++++++++++----------------
++ 3 files changed, 26 insertions(+), 26 deletions(-)
++
++diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
++index e475b42..ef35513 100644
++--- a/admin/CPP-DEFINES
+++++ b/admin/CPP-DEFINES
++@@ -244,7 +244,7 @@ HAVE_NET_IF_DL_H
++ HAVE_NET_IF_H
++ HAVE_NLIST_H
++ HAVE_OTF_GET_VARIATION_GLYPHS
++-HAVE_PERSONALITY_LINUX32
+++HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
++ HAVE_PNG
++ HAVE_PNG_H
++ HAVE_POSIX_MEMALIGN
++diff --git a/configure.ac b/configure.ac
++index bdc76bc..18387d8 100644
++--- a/configure.ac
+++++ b/configure.ac
++@@ -1478,15 +1478,17 @@ AC_CHECK_HEADERS_ONCE(
++   sys/resource.h
++   sys/utsname.h pwd.h utmp.h util.h)
++ 
++-AC_MSG_CHECKING(if personality LINUX32 can be set)
++-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/personality.h>]], [[personality (PER_LINUX32)]])],
++-               emacs_cv_personality_linux32=yes,
++-            emacs_cv_personality_linux32=no)
++-AC_MSG_RESULT($emacs_cv_personality_linux32)
++-
++-if test $emacs_cv_personality_linux32 = yes; then
++-  AC_DEFINE(HAVE_PERSONALITY_LINUX32, 1,
++-            [Define to 1 if personality LINUX32 can be set.])
+++AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE],
+++  [emacs_cv_personality_addr_no_randomize],
+++  [AC_COMPILE_IFELSE(
+++     [AC_LANG_PROGRAM([[#include <sys/personality.h>]],
+++                   [[personality (personality (0xffffffff)
+++                                  | ADDR_NO_RANDOMIZE)]])],
+++     [emacs_cv_personality_addr_no_randomize=yes],
+++     [emacs_cv_personality_addr_no_randomize=no])])
+++if test $emacs_cv_personality_addr_no_randomize = yes; then
+++  AC_DEFINE([HAVE_PERSONALITY_ADDR_NO_RANDOMIZE], [1],
+++            [Define to 1 if personality flag ADDR_NO_RANDOMIZE exists.])
++ fi
++ 
++ dnl On Solaris 8 there's a compilation warning for term.h because
++diff --git a/src/emacs.c b/src/emacs.c
++index b5d3ab4..eda439a 100644
++--- a/src/emacs.c
+++++ b/src/emacs.c
++@@ -99,7 +99,7 @@ extern void moncontrol (int mode);
++ #include <sys/resource.h>
++ #endif
++ 
++-#ifdef HAVE_PERSONALITY_LINUX32
+++#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
++ #include <sys/personality.h>
++ #endif
++ 
++@@ -833,24 +833,22 @@ main (int argc, char **argv)
++   dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0
++                           || strcmp (argv[argc - 1], "bootstrap") == 0);
++ 
++-#ifdef HAVE_PERSONALITY_LINUX32
++-  if (dumping && ! getenv ("EMACS_HEAP_EXEC"))
+++#ifdef HAVE_PERSONALITY_ADDR_NO_RANDOMIZE
+++  if (dumping)
++     {
++-      /* Set this so we only do this once.  */
++-      xputenv ("EMACS_HEAP_EXEC=true");
++-
++-      /* A flag to turn off address randomization which is introduced
++-         in linux kernel shipped with fedora core 4 */
++-#define ADD_NO_RANDOMIZE 0x0040000
++-      personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
++-#undef  ADD_NO_RANDOMIZE
++-
++-      execvp (argv[0], argv);
+++      int pers = personality (0xffffffff);
+++      if (! (pers & ADDR_NO_RANDOMIZE)
+++       && 0 <= personality (pers | ADDR_NO_RANDOMIZE))
+++     {
+++       /* Address randomization was enabled, but is now disabled.
+++          Re-execute Emacs to get a clean slate.  */
+++       execvp (argv[0], argv);
++ 
++-      /* If the exec fails, try to dump anyway.  */
++-      emacs_perror (argv[0]);
+++       /* If the exec fails, warn and then try without a clean slate.  */
+++       perror (argv[0]);
+++     }
++     }
++-#endif /* HAVE_PERSONALITY_LINUX32 */
+++#endif
++ 
++ #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK)
++   /* Extend the stack space available.
index 4844a1e3695436d3885dabffc845336536cc46f4,0000000000000000000000000000000000000000..5815010430d3300049e37a166ddcee6586984d0a
mode 100644,000000..100644
--- /dev/null
@@@ -1,21 -1,0 +1,22 @@@
 +0001-Prefer-usr-share-info-emacs-24-over-usr-share-info.patch
 +0002-Run-debian-startup-and-set-debian-emacs-flavor.patch
 +0003-Remove-files-that-appear-to-be-incompatible-with-the.patch
 +0004-Adjust-documentation-references-for-Debian.patch
 +0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch
 +0006-Look-for-NEWS-in-order-to-find-etc-rather-than-GNU.patch
 +0007-Don-t-try-to-build-src-macuvs.h-via-IVD_Sequences.tx.patch
 +0008-Emacs-won-t-assume-grep-supports-GREP_OPTIONS.patch
 +0009-Emacs-should-no-longer-hang-during-large-yanks.patch
 +0010-ELF-unexec-Correct-section-header-index.patch
 +0011-ELF-unexec-Tidy-code.patch
 +0012-ELF-unexec-Merge-Alpha-and-MIPS-COFF-debug-handling.patch
 +0013-ELF-unexec-Symbol-table-patching.patch
 +0014-ELF-unexec-_OBJC_-symbols-in-bss-sections.patch
 +0015-ELF-unexec-R_-_NONE-relocs.patch
 +0016-ELF-unexec-Drive-from-PT_LOAD-header-rather-than-sec.patch
 +0017-ELF-unexec-Don-t-insert-a-new-section.patch
 +0018-src-unexelf.c-NEW_PROGRAM_H-Remove-unused-macro-Bug-.patch
 +0019-ELF-unexec-align-section-header.patch
 +0020-Emacs-should-show-GTK-icons-again.patch
 +0021-Emacs-should-work-with-gcc-5.2-and-newer.patch
++0022-Emacs-should-work-with-glibc-2.24-on-ppc64.patch